#define _CRT_SECURE_NO_WARNINGS 1
#pragma warning(disable:6031)

#include <stdio.h>

int main()
{
	int n = 0;
	int k = 0;
	scanf("%d %d",&n, &k);
	int Asum = 0;
	int Bsum = 0;
	int Acount = 0;
	int Bcount = 0;
	int i = 0;
	for (i = 1; i <= n; i++)
	{
		if (i % k == 0)
		{
			Asum += i;
			Acount++;
		}
		else
		{
			Bsum += i;
			Bcount++;
		}
	}
	printf("%.1lf %.1lf\n", Asum * 1.0 / Acount, Bsum * 1.0 / Bcount);
	return 0;
}